<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var user= JSON.parse(sessionStorage.getItem("user"));//将json转换为对象
    //学生
    if (user.type == 0)
        if (null!=user.detail)
            window.location.href = "student/index.html";
        else
            window.location.href = "student/form.html";
    //导师
    if (user.type == 1)
        if (null!=user.detail)
            window.location.href = "teacher/index.html";
        else
            window.location.href = "teacher/form.html";
    //系主任
    if(user.type==2)
        window.location.href="director/index.html";
</script>
</body>
</html>